package com.yueka.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yueka.pojo.entity.honor.Honor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface HonorMapper extends BaseMapper<Honor> {
    @Select("SELECT id, honor_name, avatar, status, update_time, create_time FROM honor order by status")
    List<Honor> list();

    @Update("UPDATE honor SET honor_name = #{honorName}, avatar = #{avatar}, status = #{status}, update_time = #{updateTime} WHERE id = #{id}")
    void update(Honor honor);

    @Delete("DELETE FROM honor WHERE id = #{id}")
    void delete(Integer id);

    @Select("SELECT id, honor_name, avatar, status, update_time, create_time FROM honor WHERE status = '1'")
    List<Honor> weblist();
}
